home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug106 / csym.lib < prev    next >
Text File  |  1984-06-14  |  5KB  |  176 lines

  1. /*                csym.lib
  2.  
  3.     Copyright (C) 1980, M J Maney
  4.  
  5.     First created    3/1/80
  6.     Last revised    3/29/80 17:00
  7.  
  8.     This file contains some basic definitions that will be needed, or
  9.     at least useful, to the majority of C programs. Some special
  10.     purpose libraries may assume that this library file is to be
  11.     included in a source file when they are to be used.
  12. */
  13.  
  14. /*        Common symbolic constants */
  15. #define    TRUE 1
  16. #define FALSE 0
  17. #define YES 1        /* note YES is the same as TRUE, and NO is the same */
  18. #define NO 0        /* as FALSE. Sometimes one is clearer than the other */
  19. #define OK 1        /* again, the same as TRUE */
  20. #define ERR -1        /* common, though not universal, signal of distress */
  21. #define FF '\014'
  22. #define    NEWLINE '\n'
  23.  
  24. #define INFILE 0    /* symbols for open() in stdlib */
  25. #define OUTFILE 1
  26. #define IOFILE 2
  27.  
  28. #define DSKBUF 134    /* size of buffer needed for getc/putc */
  29. #define IOBUFSIZ 134    /* same as DSKBUF, but I like this name better */
  30. #define FNAMSIZ 16    /* can hold any legal filename with '\0' */
  31.  
  32. #define EOF -1        /* value getc returns on physical end of file */
  33. #define EOT 0x1A    /* value CP/M uses to delimit end of ascii files */
  34.  
  35. /*    DANGER !! the next line contains a character that the Hazeltine
  36.     does not print, but regards as its 'lead-in', so this will look
  37.     sorta funny on the tube !!! ACT prints it ok */
  38. #define #! ~        /* the C complement operator */
  39.  
  40. #define uint unsigned
  41.  
  42.  
  43. /*    Symbols used for stdlib files, collected togethere here to
  44.     ensure system concistency
  45. */
  46. #define    RAM 0
  47. #define    MAXLINE 132
  48. #define    NULL 0
  49.     /* I prefer the name NIL for a pointer to nothing */
  50. #define NIL 0
  51.  
  52. /*    Symbols for IO devices */
  53. #define CONSOLE 1
  54. #define PRINTER 2
  55. #define READER 3
  56. #define PUNCH 4
  57. #define FILE 100
  58. ret            ;else is non-space
  59.     PEND    ISSPACE
  60. ;
  61. ;
  62.     PROC    TOUPPER
  63.     lda    ARG1
  64.     mov    l,a
  65.     mvi    h,0        ;setup to return character unchanged
  66.     cpi    'a'
  67.     rc            ;less than 'a'
  68.     cpi    'z'+1
  69.     rnc            ;greater than 'z'
  70.     adi    'A'-'a'        ;else is lower-case, convert it
  71.     mov    l,a    To incorporate the changes made by HRM in stdlib1.c
  72.     and stdlib2.c into deff.crl and deff2.crl for BDS C ver 1.31,
  73.     the following sequence of commands was executed.
  74.  
  75.     note: comments are prefaced by "--"
  76.  
  77.     -- eliminate old versions in deff and make room for new
  78.  
  79. clib
  80. o 1 deff
  81. d 1 getc
  82. d 1 putc
  83. d 1 fflush
  84. d 1 sscanf
  85. d 1 sprintf
  86. d 1 _uspr
  87. d 1 fgets
  88. c 1        -- save version of deff with space available
  89. ^C        -- reboot
  90.  
  91.     -- add new versions (plus 1 new function) to deff
  92.  
  93. clib
  94. o 1 deff
  95. o 2 stdlib1
  96. o 3 stdlib2
  97. t 2 1 getc
  98. t 2 1 putc
  99. t 2 1 fflush
  100. t 2 1 ungetc    -- the new one
  101. t 3 1 sscanf
  102. t 3 1 sprintf
  103. t 3 1 _uspr
  104. t 3 1 fgets
  105. c 1        -- permanentize it
  106. ^C        -- reboot
  107.  
  108.     -- add new routines to deff2
  109.  
  110. clib
  111. o 1 deff2
  112. o 2 stdlib2
  113. t 2 1 lprintf
  114. t 2 1 pprintf
  115. t 2 1 lputs
  116. t 2 1 pputs
  117. t 2 1 rgets
  118. t 2 1 lputc
  119. t 2 1 pputc
  120. t 2 1 rgetc
  121. c 1        -- permanentize    it
  122. ^C        -- reboot
  123.  
  124.     -- update process is complete
  125.  
  126.  
  127.  
  128. VOLUME CG6
  129.  
  130. DESCRIPTION:
  131.  
  132. NUMBER    SIZE    NAME        COMMENTS
  133.  
  134.         CATALOG.CG6    CONTENTS OF CP/M VOL. CG6
  135.         HISTORY.CG6    Credits for submissions.
  136. CG6.1    1K    BIOSLB.CRL     A bios modified by Harvey Moran
  137. CG6.2    4K    BIOSLB.MAC
  138. CG6.3    9K    BIOSLB.PRN
  139. CG6.4    8K    BSPAT1-4.DOC    More by Moran on bios tinkering.
  140. CG6.5    3K    CHARFUN.ASM    Assembly version of library char
  141.                 manipulation functions.
  142. CG6.6    3K    CRL.DOC       Macro file to aid in generating 
  143.                 BDS compatible CRL files.
  144. CG6.7    8K    CRL.LIB
  145. CG6.8    2K    CSYM.LIB       Symbol file for above.
  146. CG6.9    1K    DEFFMODS.HRM     Narrative (tutorial) describing
  147.                 The modification of Moran's standard
  148.                 libraries. See STDLIB?.
  149. CG6.10    1K    FACT.MOU      Factorial program written in MOUSE
  150. CG6.13    13K    GRAVT100.C     Graphics for the VT100 in ANSI.
  151. CG6.14    9K    GRAVT100.CRL
  152. CG6.15    3K    IOFUN.ASM     Assembly version of C i/o functions.
  153. CG6.16    5K    MACHINE.ASM    Assembly crl functions, mostly
  154.                 for manipulating blocks of memory
  155. CG6.17    5K    MOUSE.C      Interpreter (originally in Pascal)
  156.                 described in BYTE. Issue date in source
  157. CG6.18    1K    NTOI.C        Small number crunching functions.
  158. CG6.19    1K    OTOI.C
  159. CG6.20    4K    PRVLIB.C     Misc. functions.
  160. CG6.21    5K    QUEUE.C      Functions to impliment FIFO's
  161.                 By Scott Layson
  162. CG6.22    1K    STDEF.C       Deff file for NTOI,OTOI,GRAVT100,
  163.                 STRINGS, UTIL1.
  164. CG6.23    4K    STDIO.DOC       Functions to simulate Unix's i/o
  165.                 redirection. Written under 1.31 and
  166.                 never tested in this form. 
  167. CG6.24    2K    STDIO.LIB
  168. CG6.25    5K    STDIO.SRC
  169. CG6.26    7K    STDLIB1.C     Modified libraries (for ver 1.32 of
  170.                 BDS C) needed with Mouse, WP.C, XTRINS.
  171. CG6.27    20K    STDLIB2.C
  172. CG6.28    4K    STRFUN.ASM    C string functions implemented in
  173.                 assembly for efficiency.
  174. CG6.29    5K    STRINGS.C      String manipulation package.
  175. CG6.30    3K    STRINGS.CRL
  176. CG6.31    2K    SYSTEM.C      Deffs for